home *** CD-ROM | disk | FTP | other *** search
- DemoForm
- (DBT Grid Data Aware via DBEngine 3.0 VBX
- Form1
- DBTGrid1
- DBTGrid
- $(Copyright (C)-1993, by Douglas A. Bebber&
- CMDialog1
- CommonDialog
- PXTable
- DBENGINE
- *$Copyright (C)-1993,Douglas A. Bebber+
- MNU_Tbl
- &Table
- MNU_TblOpen
- &Open
- MNU_TblClose
- &Close
- MNU_GridFont
- &Font
- MNU_Exit
- E&xit
- MNU_TblOpen_Click
- Status
- CMDialog1+
- DefaultExt
- DialogTitle
- Filter
- FilterIndexU
- Flags
- OFN_HIDEREADONLYK
- OFN_FILEMUSTEXIST
- CancelError
- Action
- PXTable
- TableNameD
- Filename
- Passwordq
- PasswordstrF
- AddPassword
- Reaction
- EncryptTable
- DB_OpenTable
- MNU_TblClose_ClickZ
- DB_CloseTable
- Form_Click<
- SetupTable
- DB_NFields
- DBTGrid1m
- Columns
- NFields
- DB_NRecords
- NRecords
- DataModel
- SetupGrid
- Visible
- FieldNumber8
- DB_GetFieldName
- ColumnLabels
- ColumnHeading
- FieldName(
- Column
- DBTGrid1_AbortEdit
- Form_Resize
- DemoForm
- Heightu
- MNU_Exit_Click
- Width`
- FillGrid
- DB_GetRecordI
- DB_FirstRecordn
- DB_GetField
- Texti
- FieldValue
- DB_NextRecord
- DBTGrid1_BeginEdit
- DB_LockRecord
- AbortEdit
- TopVisibleRow
- LeftVisibleColumn
- DB_UnlockRecord
- DBTGrid1_CellValueChanged
- DB_PutField+
- DB_UpdateRecordK
- DBTGrid1_GridPositionChanged~
- DBTGrid1_CellDoubleClicked
- DBTGrid1_CellFull
- DBTGrid1_ColumnAdded
- DBTGrid1_ColumnDeleted
- DBTGrid1_ColumnMoved
- DBTGrid1_ColumnSized
- DBTGrid1_GotFocus
- DBTGrid1_GridClick
- GridClickPositionU
- DBTGrid1_GridHScrollm
- DBTGrid1_GridSelectChange
- DBTGrid1_GridVScroll
- DBTGrid1_KeyStroke
- KeyAscii
- DBTGrid1_LostFocus
- DBTGrid1_MemoryError(
- DBTGrid1_Resize
- PreviousRow
- DB_PreviousRecord
- TheCursor^
- SetCursor
- LoadCursor
- IDC_WAIT5
- EventMask
- CurrentColumnm
- CurrentRow
- Redraw
- ErrorStatus
- MNU_GridFont_Click
- CF_SCREENFONTS
- CF_EFFECTS
- FontSize
- FontName
- FontBold
- FontItalic
- FontUnderline
- FontStrikethru
- Color
- ForeColor@
- Caption
- DBEngineErrorMessage
- ErrorCode`
- Used when we set the hourglass cursor while filling the grid.n
- MNU_TblOpen_Click
- Perform a CloseTable even if no table is currently open.
- Just to make sure we have no open database tables.
- Open Paradox Table
- Paradox Table (*.DB)| *.DB
- Set default filter
- Set dialog options
- Hide read only box
- Display the dialog
- User chose the OK button..
- MsgBox "Table selected: " + CMDialog1.FileName
- Move to the first field in the first database record.-
- MsgBox "Cancel was selected!"i
- MNU_TblClose_Click
- Error closing table.
- Form_Resize
- MNU_Exit_Click
- Close the database table just in case it is not already closed..
- Don't care about error..
- DBTGrid1_BeginEdit
- Can not read record!
- Can not lock record!
- DBTGrid1_CellValueChanged
- Error writing field!
- Cannot update record!"
- Cannot unlock record!"
- FillGrid
- We will fill the DBT Grid with records from the PARADOX
- database table here.
- Place the current cursor in our TheCursor variable and
- show the old hourglass.r
- Disable or mask the GridPositionChanged event here
- while we move in the grid to fill info.i
- Move to the first database record.
- Return error (if any)r
- Database Record Loop.
- Read the current database record..
- Return error (if any)e
- Database field loop.
- Read the field.e
- Return error (if any).
- Place the FieldValue in the grid cell.
- Field loop.l
- Move to next database record.h
- Record loop.
- Enable the GridPositionChanged event.d
- SetupGrid
- This function will dimension the DBT Grid to fit the database table
- record structure (one grid cell for every database field). In this
- function we only create as many grid cells as there are fields in the
- database table.y
- We then label the DBT Grid columns with the field names stored in the
- Paradox database table.r
- Note that this simple demo processes Paradox database tables in batch mode.a
- We fill the entire database table into the grid. For large database tables
- this method may prove unacceptable for performance reasons. In that case
- you will want to buffer the database table through the DBT Grid. A sample
- demo program illustrating the mechanics of this buffering implementation
- will be coming soon.
- To accomodate multi-user environments we have provided code (found in the
- DBT Grid's GridPositionChanged event routine) that refreshes the grid based
- table image when the number of records in the database varies from the
- number of rows in the grid.
- This demo's updating of database records will
- work in multi-user environments. No references to absolute record numberse
- are present in the code. Record locks must be successfully obtained before
- grid cell editing is allowed. When grid cell edits are completei
- (EndEdit event routine) the appropriate record is updated and unlocked.o
- In the case of an (AbortEdit event) the record is not updated and unlocked.
- Get the number of fields in the database table.e
- Return an error (if any).
- Dimension the DBT Grid based on the table field count.
- Return an error (if any).d
- Get the number of records in the databasea
- Return an error (if any).e
- Large data set
- Dimension the DBT Grid rowse
- based on table record count.
- Can not allocate enough grid rows!
- Now label the Grid Fields with the field names found in the database..
- User defined.d
- Return an error (if any).m
- DBTGrid1_AbortEdit
- Can not unlock record!
- DBTGrid1_GridPositionChanged
- The user has moved within the grid!
- We need to make sure that we are positioned on
- the correct record in the database!s
- But first see if we need to refresh the grid.n
- Move back in the databaseh
- Move ahead in the database
- MNU_GridFont_Click
- This is a crude routine which allows the user to change-
- the grid fonts only screen fonts are allowed.
- DBEngineErrorMessage
- This subroutine accepts a DBEngine error code (passed to the
- subroutine most likely from the DBEngine.Reaction property).
- The subroutine then just displays a message box reporting the
- exact error to the user.
- Drive not ready.
- Directory not found.
- File is busy."
- File is locked."
- File not found."
- Table is damaged."
- Primary index is damaged."
- Primary index is out of date."
- Record is locked."
- Sharing violation - directory is busy.
- Sharing violation - directory is locked.
- No access to directory."
- Sort for index differs from that of table.
- Single user but directory is shared.
- Multiple PARADOX.NET files found."
- Insufficient password rights."
- Table is write-protected."
- Data type mismatch."
- Argument out of range.
- Invalid argument."
- Not enough memory to complete the operation.
- Not enough disk space to complete the operation.
- Another user deleted the record.
- BLOB open mode, action N/A."
- BLOB already open.
- Invalid BLOB offset.
- Invalid BLOB size.
- Other user modified BLOB."
- Bad BLOB file.
- Can not index on BLOB.
- Bad BLOB handle.
- Can not search on BLOB."
- No more file handles available."
- No more table handles available.
- Invalid date."
- Invalid field name."
- Invalid field handle."
- Invalid table handle."
- Engine not initialized."
- Previous fatal error, cannot continue.
- Table structures are different."
- Engine already initialized."
- Unable to perform operation on an open table."
- No more temporary names available.
- Record not found."
- Table is indexed."
- Table is not indexed."
- Secondary index is out of date."
- Key violation.
- Could not login on network."
- Invalid table name."
- End of table."
- Start of table."
- No more record handles available."
- Invalid record handle.
- Operation on an empty table.
- Invalid lock code.
- Engine not initialized."
- Invalid file name.
- Invalid lock."
- Invalid lock handle.
- Too many locks on table.
- Invalid sort-order table."
- Invalid net type."
- Invalid directory name."
- Too many passwords submitted."
- Invalid password."
- Buffer too small for the result.
- Table is busy.
- Table is locked.
- Table was not found.
- Secondary index was not found.
- Secondary index is damaged."
- Secondary index is already open.
- Disk is write-protected.
- Record is too big for index.
- General hardware error."
- Not enough stack space to complete the operation."
- Table is full.
- Not enough swap buffer space to complete the operation."
- Table is SQL replica."
- Too many clients for the Engine DLL.
- Exceeds limits specified in WIN.INI file."
- Too many files open simultaneously (includes all clients).
- Can't lock PARADOX.NET, is SHARE.EXE loaded?
- Can't run the Engine in Windows REAL mode.
- Can't modify unkeyed table with a non-maintained secondary index."
- Timed out performing lock operation.
- Unknown error.
- Database Error
-